package com.block.common.exception;


import cn.hutool.core.util.StrUtil;
import lombok.Data;

/**
 * 业务异常类
 * 用于处理需要发送报警信息的异常信息处理
 */
@Data
public class BizException extends  ApiException{
    private  String errorCode;
    private String errorMsg;
    public BizException(){

    }
    public BizException(String errorCode, String errorMsg){
        this.errorCode=errorCode;
        this.errorMsg=errorMsg;
    }

    /**
     *
     * @param errorCode
     * @param errorMsg {}占位符拼接字符串
     * @param msgFmt
     */
    public BizException(String errorCode, String errorMsg,Object ... msgFmt ){
        this.errorCode=errorCode;
        this.errorMsg= StrUtil.format(errorMsg,msgFmt);
    }
    public BizException(String message) {
        super(message);
    }

    public BizException(String message, Throwable cause) {

        super(message, cause);
    }
}
